<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="cityList.title"/></title>
    <meta name="heading" content="<fmt:message key='cityList.heading'/>"/>
    <meta name="menu" content="CityListMenu"/>
</head>

<c:set var="buttons">
    <input type="button" style="margin-right: 5px"
        onclick="location.href='<c:url value="/admin/cityForm.html?method=Add&from=list"/>'"
        value="<fmt:message key="button.add"/>"/>

    <input type="button" onclick="location.href='<c:url value="/mainMenu.html"/>'"
        value="<fmt:message key="button.done"/>"/>
</c:set>

<c:out value="${buttons}" escapeXml="false" />
<div class="clear">
</div>
<div class="buttons" style="float:left;padding-right:15px;">

<form:form commandName="citySearch" method="post" action="cityList.html">
	<fieldset style="width: 125%;">
		<legend>
			<fmt:message key="city.searchForm" />
		</legend>
		<table>
			<tr>			
				<td><appfuse:label styleClass="desc" key="city.txtSearch"/></td>
				<td><form:select path="country" items="${countryList}" itemLabel="name" itemValue="id" /></td>
			</tr>
			<tr>
				<td><appfuse:label styleClass="desc" key="city.txtSearch"/></td>
				<td><form:input path="name" /></td>
			</tr>
			
		</table>
		<button type="button" class="negative" id="searchForm_button_reset"  onclick="resetFields();">
			<fmt:message key="button.reset" />
		</button>
		<button type="submit" class="searchb" id="searchForm_button_search" name="search">
			<fmt:message key="button.search" />
		</button>
	</fieldset>
</form:form>
</div>
<div class="clear">
</div>

<display:table name="cityList" cellspacing="0" cellpadding="0" defaultsort="1" id="cityData" pagesize="25" class="table" export="true" style="width: 125%;">
    <display:column property="code" sortable="true" titleKey="cityData.code" escapeXml="true" style="width: 30%" 
    url="/admin/cityForm.html?from=list" paramId="id" paramProperty="id"/>
	<display:column property="name" sortable="true" titleKey="cityData.name" style="width: 30%"/>
	<display:column property="country.name" sortable="true" titleKey="country.name" style="width: 30%"/>
    
    <display:setProperty name="paging.banner.item_name" value="cityData"/>
    <display:setProperty name="paging.banner.items_name" value="cityList"/>

    <display:setProperty name="export.excel.filename" value="City List.xls"/>
    <display:setProperty name="export.csv.filename" value="City List.csv"/>
    <display:setProperty name="export.pdf.filename" value="City List.pdf"/>
</display:table>

<c:out value="${buttons}" escapeXml="false" />

<script type="text/javascript">
    highlightTableRows("cityData");
</script>
